#include <iostream>
#include <glibmm.h>

#include "../Shared/Shared.hpp"
#include "../PreProcessor/TokenizerInput.hpp"
#include "../PreProcessor/FileParser.hpp"
#include "../PreProcessor/PreProcDOM.hpp"
#include "../PreProcessor/PreProcessor.hpp"

static void init()
{
  BuildNG::init_shared();
  CPreProc::init();
}

static void shutdown()
{
  CPreProc::shutdown();
  BuildNG::shutdown_shared();
}

int main()
{
  try
  {
    init();

    BuildNG::FileInStream in_stream("C:/BuildNG/1/TestFiles/gatomic.c");
    //BuildNG::StdInStream in_stream(&std::cin,false);    
    Glib::RefPtr<CPreProc::PreProcFile> preproc_file = CPreProc::PreProcFile::parse(in_stream);

    shutdown();
    return 0;
  }
  catch(const Glib::Exception &err)
  {
    std::cerr << err.what() << std::endl;

    shutdown();
    return -1;
  }
  catch(const std::exception &err)
  {
    std::cerr << err.what() << std::endl;

    shutdown();
    return -1;
  }
}